/**
 *
 * by littlefean
 */

function randomArr(len) {
    let res = [];
    for (let i = 0; i < len; i++) {
        res.push(Math.floor(Math.random() * 100));
    }
    return res;
}

window.onload = function () {

    let N = 30;

    let arr1 = new AnimationArray(randomArr(N), d.get(".a1"));
    arr1.selectSort();
    //
    let arr2 = new AnimationArray(randomArr(N), d.get(".a2"));
    arr2.bubbleSort();
    //
    let arr3 = new AnimationArray(randomArr(N), d.get(".a3"));
    arr3.insertSort();
    //
    let arr4 = new AnimationArray(randomArr(N), d.get(".a4"));
    arr4.mergeSort();
    //
    let arr5 = new AnimationArray(randomArr(N), d.get(".a5"));
    arr5.quickSort();
    //
    let arr6 = new AnimationArray(randomArr(N), d.get(".a6"));
    arr6.heapSort();
}
